home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / music / eked-m1.zoo / src / types.h < prev    next >
Text File  |  1995-02-19  |  5KB  |  144 lines

  1. /*
  2.  *  EKED-M1 : Editor for Korg M1 synth; types.h : global typedefs
  3.  *  Copyright (C) 1995 Steven M. Eker (Steven.Eker@brunel.ac.uk)
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. typedef char BOOL;
  21. typedef signed char BYTE;
  22. typedef unsigned char UBYTE;
  23.  
  24. typedef enum {
  25. /*
  26.  *    Regular (single byte) parameter types (handled via attribute table)
  27.  */
  28.   UNUM,        /* unsigned number 0..99 */
  29.   UN3,        /* unsigned number 0..3 */
  30.   SNUM,        /* signed number -99..99 */
  31.   SN12,        /* signed number -12..12 */
  32.   SN50,        /* signed number -50..50 */
  33.   MSND,        /* multisound 0..? */
  34.   OCT,        /* octave -1,0,1 (16', 8', 4') */
  35.   NOTE,        /* note number 0..127 (C1 .. G9) */
  36.   OMOD,        /* oscillator mode 0,1,2 (single, double, drum) */
  37. /*
  38.  *    Types needed for global parameters
  39.  */
  40.   POL,        /* polarity 0, 1 (+, -) */
  41.   PED,        /* pedal function 0..9 (lengthy options) */
  42.   SCAL,        /* scale type 0..4 (lengthy options) */
  43.   KEY,        /* key 0..11 (C, C#, D,..., A#, B) */
  44.   DSND,        /* drum sound 0..44 (0 is OFF) */
  45.   DKEY,        /* drum key 12..115 (C0 .. G8) */
  46.   S120,        /* signed number -120 .. 120 */
  47. /*
  48.  *    Types needed for effect  & combination parameters
  49.  */
  50.   VEL,        /* velocity 1..127 */
  51.   REV1,        /* reverb time 0..97 ( * 0.1 + 0.2 seconds) */
  52.   REV2,        /* reverb time 0..47 ( * 0.1 + 0.2 seconds) */
  53.   ERT1,        /* early reflect time 0..70 ( * 10 + 100 milliseconds) */
  54.   ERT2,        /* early reflect time 0..30 ( * 10 + 100 milliseconds) */
  55.   UN9,        /* unsigned number 0..9 */
  56.   SN10,        /* signed number -10..10 */
  57.   BAL,        /* balance 0..100 (dry:eff, 0:100 to 100:0) */
  58.   PAN,        /* panpot 0..101 (OFF, R, 01:99 to 99:01, L) */
  59.   LFC,        /* lo freq cutoff 0..2 (0.25, 0.5, 1 KHz) */
  60.   HFC,        /* hi freq cutoff 0..2 (1, 2, 4 KHz) */
  61.   DEL1,        /* delay or pre-delay 0..50 (milliseconds) */
  62. /*
  63.  *    The following need to be handled as unsigned bytes
  64.  */
  65.   DEL2,        /* delay or pre-delay 0..150 (milliseconds) */
  66.   DEL3,        /* delay or pre-delay 0..200 (milliseconds) */
  67.   SPED,        /* speed 0..216 (complex mapping) */
  68. /*
  69.  *    Irregular (bit/multi-byte) parameter types (handled via custom code)
  70.  */
  71.   PROG,        /* program number 0..199 (but may go to -1 for OFF) */
  72.   WAVE,        /* waveform 0..3 (triangle, up saw, down saw, square) */
  73.   AMOD,        /* assign mode 0,1 (poly, mono) */
  74.   BIT0,        /* on-off switch, bit 0 */
  75.   BIT1,        /* on-off switch, bit 1 */
  76.   BIT2,        /* on-off switch, bit 2 */
  77.   BIT3,        /* on-off switch, bit 3 */
  78.   BIT4,        /* on-off switch, bit 4 */
  79.   BIT5,        /* on-off switch, bit 5 */
  80.   BIT6,        /* on-off switch, bit 6 */
  81.   BIT7,        /* on-off switch, bit 7 */
  82.   TRI0,        /* -,0,+ switch, bits 0 & 4 */
  83.   TRI1,        /* -,0,+ switch, bits 1 & 5 */
  84.   TRI2,        /* -,0,+ switch, bits 2 & 6 */
  85.   TRI3,        /* -,0,+ switch, bits 3 & 7 */
  86.   NM10,        /* name 10-char string */
  87. /*
  88.  *    Irregular parameter types needed for effects & combinations
  89.  */
  90.   TWAV,        /* waveform 0..1 (SIN, TRI) */
  91.   DEL4,        /* delay time 0..500 (milliseconds) */
  92.   ROUT,        /* routing 0..1 (parallel, serial) */
  93.   DIS0,        /* dis-ena switch, bit 0 */
  94.   DIS1,        /* dis-ena switch, bit 1 */
  95.   DIS2,        /* dis-ena switch, bit 2 */
  96.   DIS3,        /* dis-ena switch, bit 3 */
  97.   CHAN,        /* MIDI channel 0..15 (displays as 1..16) */
  98.   CPAN,        /* combination pan 0..13 (A, 9:1 to 1:9, B, C, C+D, D) */
  99.  
  100.   NPRM        /* special null entry to mark unused parameter */
  101. } PARA_TYPE;
  102.  
  103. typedef struct {
  104.   int ob_number;    /* object number in object tree */
  105.   int offset;        /* offset in program data structure */
  106.   PARA_TYPE type;    /* parameter type */
  107.   int s_page;        /* M1 page in single osc mode */
  108.   int d_page;        /* M1 page in double osc mode */
  109.   int position;        /* position in M1 page */
  110. } PARAMETER;
  111.  
  112. typedef struct {
  113.   char *name;        /* pointer to string naming the parameter */
  114.   PARA_TYPE type;    /* parameter type */
  115.   int def_val;        /* default value */
  116.   int data_pos;        /* position in effect data (0-7) or -ve for routing */
  117. } EPARAMETER;
  118.  
  119. typedef struct {
  120.   char *name;        /* pointer to string naming effect */
  121.   EPARAMETER param[8];    /* parameter for each display position */
  122. } EFFECT;
  123.  
  124. typedef struct {
  125.   int bank_nr;        /* bank number */
  126.   int glob_win;        /* window to redraw when global data changed */
  127.   int comb_win;        /* window to redraw when program data changed */
  128.   int prog_win;        /* window to redraw when combination data changed */
  129.   BYTE data[GLOBAL_SIZE + 100 * COMBINATION_SIZE + 100 * PROGRAM_SIZE];
  130.             /* all data */
  131.   char filename[FILE_SPEC_SIZE];
  132. } BANK;
  133.  
  134. typedef enum {
  135.   COMB_LIST, 
  136.   PROG_LIST
  137. } LW_TYPE;
  138.  
  139. typedef enum {
  140.   DRAG_BANK,
  141.   DRAG_COMB,
  142.   DRAG_PROG
  143. } DRAG_TYPE;
  144.